package com.wj.server.utils;

import com.wj.server.pojo.Admin;
import org.springframework.security.core.context.SecurityContextHolder;


/**
 * 操作员工具类
 * @author WangJin
 * @version 1.0
 * @date 2022/3/4 11:35
 */

public class AdminUtils {

    /**
     * 获取当前登录操作员
     *
     * @return
     */
    public static Admin getCurrentAdmin() {
        return (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }

}
